package com.apimarket.util.kong;

import com.apimarket.entity.kong.Plugin;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

/**
 * Kong Plugin具体操作抽象类，同时提供KongPluginOperation接口的默认实现
 * 使其子类可选择性覆盖
 *
 * @author yyc
 */
public abstract class KongPlugin extends KongBase implements KongPluginOperation {
    protected static final String addPath = "/plugins";

    protected static final String listPath = "/plugins";

    protected static final String updatePath = "/plugins";

    protected static final String deletePath = "/plugins";

    public KongPlugin() {
    }

    public KongPlugin(String baseUrl) {
        super(baseUrl);
    }

    @Override
    public Plugin addPlugin(Plugin plugin) throws IOException, URISyntaxException {
        return null;
    }

    @Override
    public Plugin updatePlugin(Plugin plugin) throws IOException, URISyntaxException {
        return null;
    }

    @Override
    public void deletePlugin(String id) throws IOException, URISyntaxException {
    }

    @Override
    public List<Plugin> listPlugin(Plugin plugin) throws IOException, URISyntaxException {
        return null;
    }

    public List<Plugin> findServicePlugin(String id) throws IOException, URISyntaxException{
        return null;
    }

    public abstract Plugin addPluginAndJudge(Plugin plugin, String operationType) throws IOException, URISyntaxException;

    public abstract List<Plugin> finRoutePlugins(String id) throws IOException, URISyntaxException;
}
